pygrub: parse xen module option in grub
authorKeir Fraser <keir.fraser@citrix.com>
Fri, 20 Feb 2009 11:08:31 +0000 (11:08 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Fri, 20 Feb 2009 11:08:31 +0000 (11:08 +0000)
Add function for GrubConf to parse xen module option in grub.
Pygrub should pass args as domUloader did.

Signed-off-by: Wei Kong <weikong.cn@gmail.com>
tools/pygrub/src/pygrub

index ae15af187ef0efd1ef0e30ce1ac24242b5ab43c1..e4482afeb55bf3056591c596a43aa95a3d68286d 100644 (file)
@@ -501,7 +501,7 @@ def get_entry_idx(cf, entry):
 
     return None
 
-def run_grub(file, entry, fs):
+def run_grub(file, entry, fs, arg):
     global g
     global sel
 
@@ -534,7 +534,7 @@ def run_grub(file, entry, fs):
     if img.initrd:
         grubcfg["ramdisk"] = img.initrd[1]
     if img.args:
-        grubcfg["args"] = img.args
+        grubcfg["args"] = img.args + " " + arg
 
     return grubcfg
 
@@ -659,7 +659,7 @@ if __name__ == "__main__":
     chosencfg = sniff_solaris(fs, incfg)
 
     if not chosencfg["kernel"]:
-        chosencfg = run_grub(file, entry, fs)
+        chosencfg = run_grub(file, entry, fs, incfg["args"])
 
     data = fs.open_file(chosencfg["kernel"]).read()
     (tfd, bootcfg["kernel"]) = tempfile.mkstemp(prefix="boot_kernel.",